<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
    <link rel="stylesheet" href="" />
  </head>
  <body>
    <button id="a">引入a</button>
    <button id="b">引入b</button>
    <script>
      a.onclick = function () {
        let link = document.createElement("link");
        link.href = "./a.css";
        link.rel = "stylesheet";
        document.querySelector("head").appendChild(link);
      };
      b.onclick = function () {
        let link = document.createElement("link");
        link.href = "./b.css";
        link.rel = "stylesheet";
        document.querySelector("head").appendChild(link);
      };
    </script>
  </body>
</html>
